package com.ruicar.afs.cloud.afscase.approvetask.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.afscase.approvetask.condition.WorkTaskPoolCondition;
import com.ruicar.afs.cloud.afscase.approvetask.entity.WorkTaskPoolHistory;
import com.ruicar.afs.cloud.afscase.approvetask.vo.ApproveTaskVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description 审批任务历史mapper
 * @Author Peng_Jinbo
 * @Date 2020/06/02 10:53
 */
public interface WorkTaskPoolHistoryMapper extends BaseMapper<WorkTaskPoolHistory> {

    //经我处理
    IPage<ApproveTaskVo> queryDealWithTaskList(Page page, @Param("workTaskPoolCondition") WorkTaskPoolCondition workTaskPoolCondition);
    //查询部长退回的全部原因
    List<WorkTaskPoolHistory> queryAllData(@Param("applyNo") String applyNo, @Param("stageId") String stageId, @Param("currentNodeId") String currentNodeId);
    List<WorkTaskPoolHistory> findAllData(@Param("applyNo") String applyNo, @Param("stageId") String stageId, @Param("currentNodeId") String currentNodeId);

    @Select("select * from work_task_pool_his where task_node_Id = #{nodeId} and stage_id = #{stageId} and del_flag = '1' order by create_time desc")
    List<WorkTaskPoolHistory> listAlreadyDelTaskHistory(@Param("nodeId")String nodeId, @Param("stageId")String stageId);
}
